package com.demo.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.demo.domain.vo.CommentView;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.List;

@Data
@TableName("tb_post")
public class Post {
    @TableId(type = IdType.AUTO, value = "p_id")
    @TableField(value = "p_id")
    private Long id;
    @TableField(value = "p_uid")
    private Long uid;
    @TableField(value = "p_unickname")
    private String unickname;
    @TableField(value = "p_title")
    private String title;
    @TableField(value = "p_content")
    private String content;
    @TableField(value = "p_release_time")
    @JsonFormat(timezone = "GMT+8",pattern="yyyy-MM-dd HH:mm:ss")
    private LocalDateTime releaseTime;
    @TableField(value = "p_comments")
    //    评论数
    private int comments;
    @TableField(value = "p_image_url")
    //    帖子上传的图片
    private String imageUrl;
    @TableField(value = "p_type")
    //    帖子分区类（0—创意空间1—学生组队2—教师招募3—畅聊天地）
    private int type;

//    @TableField(exist = false)
//    private List<Comment> commentList;

    @TableField(exist = false)
    private List<CommentView> commentViewList;

    @TableField(exist = false)
    private List<String> imageUrls;

}
